package com.example.sw.myapp0928;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ListView;

import com.example.sw.myapp0928.Bean.AlamItem;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private ListView lv;
    private List<AlamItem> itemList= new ArrayList<>();
    private NaoZhongAdapter adapter;





    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        setListener();




    }

    private void setListener() {


    }

    private void initView() {

        lv=findViewById(R.id.lv);
        //填充数据源 无参
        AlamItem a=new AlamItem();
        a.setTime("12:01");
        a.setIschecked(false);
        itemList.add(a);
        //有参
        AlamItem a1=new AlamItem("12:10",false);
        itemList.add(a1);
        AlamItem a2=new AlamItem("12:12",false);
        itemList.add(a2);
        adapter= new NaoZhongAdapter (MainActivity.this,R.layout.list_item,itemList);
        lv.setAdapter(adapter);



    }
}
